package com.ctgu.chatapp

import com.ctgu.chatapp.model.Retrofit.IMSServiceImpl
import com.ctgu.chatapp.model.pojo.FriendShip
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Dispatchers.IO
import kotlinx.coroutines.launch
import net.sourceforge.pinyin4j.PinyinHelper
import org.junit.Test

class RetrofitTest {
    @Test
    fun testLogin() {
        CoroutineScope(IO).launch {
//            val service = IMSServiceImpl.imsServiceImpl.service.getLogin(15171872273, "123456")
//            println(service)
        }
    }

    @Test
    fun chineseWord2Pinyin() {
        val name = "佘拓"
        val str = PinyinHelper.toHanyuPinyinStringArray(name.toCharArray()[0])
        print(str[0][0].uppercaseChar())
    }

    @Test
    fun getInformation() {
        CoroutineScope(IO).launch {
            val service = IMSServiceImpl.imsServiceImpl.service.getInformation(100001)
            print(service)
        }
    }

    @Test
    fun testFriendList() {
        val newList = mutableListOf<FriendShip>()
        val oldList = mutableListOf<FriendShip>()
        val temp = newList.toMutableList()
        temp.removeAll(oldList)
        oldList.removeAll(newList)
    }
}